package me.softwareengineer.guice.rendering.listener;

import java.util.Map;

/**
 * 
 * @author yad.tahir
 * 
 *         <pre>
 * This class is thread-safe and immutable.
 * </pre>
 */
public class OnMacroEvent extends EventHasProperties implements OnElementEvent {

	/**
	 * Holds the id of macro. For instance, php for php macro
	 */
	private String id;
	/**
	 * The macro content that we are preserving.
	 */
	private String content;

	/**
	 * The macro is located in a inline content (like paragraph, etc.).
	 */
	private boolean isInline;

	/**
	 * Creates an on macro event
	 * 
	 * @param id
	 *            the id of the macro
	 * @param isInline
	 *            the inline mode
	 * @param content
	 *            the content or script of the macro
	 * @param properties
	 *            the properties of the element
	 */
	public OnMacroEvent(String id, boolean isInline, String content,
			Map<String, String> properties) {
		super(properties);
		this.id = id;
		this.content = content;
		this.isInline = isInline;
	}

	/**
	 * 
	 * @return the content or the script of the macro
	 */
	public String getContent() {
		return content;
	}

	/**
	 * 
	 * @return the id of macro. For instance, php for php macro
	 */
	public String getId() {
		return id;
	}

	/**
	 * 
	 * @return if true the macro is located in a inline content (like paragraph,
	 *         etc.).
	 */
	public boolean isInline() {
		return isInline;
	}

}
